package com.tianquan.miracle.aop;/**
 * @author starsea
 * @date 2024-10-09 上午11:09
 */

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

/**
 * @BelongsProject: uploaddemo
 * @BelongsPackage: com.tianquan.miracle.aop
 * @Author: tianquan
 * @CreateTime: 2024-10-09  11:09
 * @Description: 连接点实现
 * @Version: 1.0
 */
public class JoinPintImpl implements JoinPoint {

    Object object;

    Method method;

    Object[] args;

    public JoinPintImpl(Object object, Method method, Object[] args) {
        this.args = args;
        this.method = method;
        this.object = object;
    }

    public Object proceed() throws Throwable {
        return method.invoke(object, args);
    }

    public Object proceed(Object[] args) throws Throwable {
        return method.invoke(object, args);
    }

    public Object getTarget() {
        return object;
    }

    public Object[] getArgs() {
        return args;
    }

    public Annotation[] getAnnotations() {
        return Object.class.getAnnotations();
    }

    public Method getMethod() {
        return this.method;
    }


}
